#ifndef RATINGWIDGET_H
#define RATINGWIDGET_H

#include <QtGui>

class RatingWidget : public QLabel
{
	Q_OBJECT
public:
	explicit RatingWidget(QByteArray docHash = QByteArray(), int rating = 0, QWidget *parent = 0);
	
signals:
	void ratingChanged(QByteArray docHash, int rating);
	
public slots:
	void setRating(int rating);
	
protected:
	int rating;
	QByteArray docHash;

	int ratingFromClick(QMouseEvent *ev);
	void mousePressEvent(QMouseEvent *ev);
	void mouseMoveEvent(QMouseEvent *ev);
	void mouseReleaseEvent(QMouseEvent *ev);
};

#endif // RATINGWIDGET_H
